<template>
	<view class="mx-vip-card-detail">
		<view class="card-img" :style="{backgroundImage: `url(${cardImg})`}"></view>
		<view class="card-price">￥ {{info.price}}</view>
		<view class="card-info">
			<text class="info-title">{{info.card_name}} </text>
			<text class="info-detail">{{info.introduce}}</text>
		</view>
		<view class="card-info">
			<text class="info-title">有效期</text>
			<text class="info-detail">{{info.effective}}天</text>
		</view>
		<!-- 当 type 为 1 时，为有限次数卡 -->
		<view  class="card-info">
			<text class="info-title">有效次数</text>
			<text v-if="info.type == 1" class="info-detail">{{info.limite}}次</text>
			<text v-if="info.type != 1" class="info-detail">不限次数</text>
		</view>
<!-- 		<view class="card-info">
			<text class="info-title">生效时间</text>
			<text class="info-detail">即时生效</text>
		</view> -->
		<view class="card-info">
			<text class="info-title">使用规则</text>
			<text class="info-detail">{{info.use_rules}}</text>
		</view>
	</view>
</template>

<script>
	import { imgUrl } from '@/utils/config.js'
	export default {
		name:"MxVipCardDetail",
		props:{
		   info: {
			   type: Object
		   },
		   
		   image: {
			   type: String
		   }
		},
		computed: {
			cardImg() {
				if(this.image) {
					return imgUrl + this.image
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
@import '@/common/scss/var.scss';
@import '@/common/scss/mixins.scss';
.mx-vip-card-detail{
	width: 700rpx;
	display: flex;
	flex-direction: column;
	align-items: center;
	font-family: $font-family;
	.card-img{
		margin-top: 72rpx;
		width: 700rpx;
		height: 408rpx;
		@include bg-img-cover;
	}
	
	.card-price{
		margin-top: 42rpx;
		box-sizing: border-box;
		padding-left: 18rpx;
		width: 100%;
		color: $color-amount;
		font-weight: bold;
		font-size: 18px;
	}
	
	.card-info{
		margin-top: 60rpx;
		width: 100%;
		box-sizing: border-box;
		padding-left: 18rpx;
		display: flex;
		flex-direction: column;
		.info-title{
			font-weight: bold;
			font-size: 18px;
		}
		
		.info-detail{
			margin-top: 20rpx;
			font-size: 16px;
		}
		
		&:nth-child(3) {
			margin-top: 20rpx;
		}
	}
}
</style>
